home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 229 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  900 b 

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: help on syntax
  5. Date: 3 Jan 1996 05:52:24 GMT
  6. Organization: Kalevi, Inc
  7. Message-ID: <4cd5io$7qg@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe4.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Jan 02, 1996 22:27:28 in article <help on syntax>, 'Paul Abrilla
  15. <APCCU@CUNYVM.CUNY.EDU>' wrote: 
  16.  
  17.  
  18. >I'm trying to run a simple program, but I'm getting a 'misplaced 
  19. >else' error everytime I compile it.  [... rest deleted ..] 
  20.  
  21. Read up on the use of braces. 
  22. >if (c = (a-b)) 
  23.    {  // Ya needs one here 
  24. >cout << "a: "; 
  25. >cout << a; 
  26. >cout << " minus b: "; 
  27. >cout << b; 
  28. >cout << " quals c: "; 
  29. >cout << c << endl; 
  30.   }  // and here 
  31. >else 
  32. >cout << "a-b does not equal c: " << endl; 
  33.  
  34. -- 
  35.  
  36. Pete 
  37.  
  38.  
  39.  
  40.  
  41.  
  42.